home *** CD-ROM | disk | FTP | other *** search
/ How Would You Survive? / How Would You Survive (1995)(Grolier)[Mac-PC].iso / mac / SHARED.DIR / 01977_Script_aTheatreButton < prev    next >
Text File  |  1995-09-13  |  2KB  |  73 lines

  1. property pSprite,pCast,pNutral,pHilighted,pSelected,pFunction,pMySound,pCursor,¼
  2.          pbeenClicked,phelpStatus
  3.  
  4. on birth me,theSprite,theCast,aSound,aFunction,aCursor
  5.   -- assumes that the sprite has the correct cast member in the correct loc
  6.   -- assumes that the normal and depressed art are in cast numbers theCast and theCast + 1
  7.   set pSprite = theSprite
  8.   set pcursor = aCursor
  9.   set pCast = theCast
  10.   set pMySound = aSound
  11.   set pNutral = pCast
  12.   set pHilighted = pCast + 1
  13.   set pSelected = pCast + 2
  14.   set pFunction = aFunction
  15.   set phelpStatus = 0
  16.   puppetSprite pSprite,TRUE
  17.   set the castNum of sprite pSprite = pCast
  18.   return me
  19. end
  20.  
  21. on setNewFunction me, aFunction 
  22.   set pFunction = aFunction
  23. end
  24.  
  25. on setNewSound me, aNewSound 
  26.   set pMySound = aNewSound
  27. end
  28.  
  29. on TurnOnHelpSound me
  30.   set phelpStatus = 1
  31. end
  32.  
  33. on TurnOffHelpSound me
  34.   set phelpStatus = 0
  35. end
  36.  
  37. on reset me
  38.   set the castNum of sprite pSprite = pNutral
  39.   updatestage
  40. end
  41.  
  42. on hilight me
  43.   if (rollover(pSprite)) then
  44.     if (the castNum of sprite pSprite = pNutral) then
  45.       set the castNum of sprite pSprite = pHilighted 
  46.       Updatestage
  47.     end if
  48.     if (the mouseDown) then
  49.       if (not(the castNum of sprite pSprite = pSelected)) then
  50.         puppetsound "FeatureButSplClk.AIFF" 
  51.       end if
  52.       set the castNum of sprite pSprite = pSelected
  53.       Updatestage
  54.       wait .2
  55.       do pFunction        
  56.       abort
  57.     end if
  58.   else
  59.     reset me
  60.   end if
  61.   return FALSE
  62. end
  63.  
  64.  
  65. on hideControl me
  66.   puppetSprite pSprite, FALSE
  67. end
  68.  
  69. on showControl me
  70.   puppetSprite pSprite,TRUE
  71. end 
  72.  
  73.